- Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathsource.cpp
26 lines (23 loc) · 740 Bytes
/
source.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#using <System.dll>
usingnamespaceSystem;
usingnamespaceSystem::Diagnostics;
public ref classTest
{
// <Snippet1>
// Class-level declaration.
// Create a TraceSwitch.
static TraceSwitch^ generalSwitch =
gcnew TraceSwitch( "General","Entire Application" );
public:
staticvoidMyErrorMethod( Object^ myObject )
{
// Write the message if the TraceSwitch level is set to Error or higher.
#if defined(DEBUG)
Debug::WriteIf( generalSwitch->TraceError, myObject );
// Write a second message if the TraceSwitch level is set to Verbose.
Debug::WriteLineIf( generalSwitch->TraceVerbose,
" is not a valid value for this method." );
#endif
}
// </Snippet1>
};